import request from '@/utils/request'

// 查询库存列表
export function listStock(query) {
  return request({
    url: '/system/stock/list',
    method: 'get',
    params: query
  })
}

// 查询库存详细
export function getStock(id) {
  return request({
    url: '/system/stock/' + id,
    method: 'get'
  })
}

// 新增库存
export function addStock(data) {
  return request({
    url: '/system/stock',
    method: 'post',
    data: data
  })
}

// 修改库存
export function updateStock(data) {
  return request({
    url: '/system/stock',
    method: 'put',
    data: data
  })
}

// 删除库存
export function delStock(id) {
  return request({
    url: '/system/stock/' + id,
    method: 'delete'
  })
}
// 查询库存操作详细
export function getOperationdetailsAPI(id) {
  return request({
    url: '/system/stock/stockMsg_get/' + id,
    method: 'get'
  })
}
// 库存产品重订货规则
export function getReorderRules(id){
  return request({
    url:'system/stock/getReorderRules/'+id,
    method:'get'
  })
}
// 库存产品供应商名称  供应商报价
export function getSupplierinfo(id){
  return request({
    url:'system/stock/supplierinfo/'+id,
    method:'get'
  })
}
// 查询库存产品的采购历史
export function getPurchaseHty(id){
  return request({
    url:'system/stock/purchaseHty/'+id,
    method:'get'
  })
}
// 查询库存产品的销售历史
export function getSaleHty(id){
  return request({
    url:'system/stock/saleHty/'+id,
    method:'get'
  })
}
// 查询库存产品的物料清单
export function getStkBomPart(id){
  return request({
    url:'system/stock/stkBomPart/'+id,
    method:'get'
  })
}
// 查询包含该库存产品的物料清单
export function getStkBomBlt(id){
  return request({
    url:'system/stock/stkBomBlt/'+id,
    method:'get'
  })
}
// 库存产品详情页的供应商信息添加
export function getsupplieradd(query){
  return request({
    url:'system/stock/supplier_add/',
    method:'post',
    data:query
  })
}
// 库存产品详情页的供应商信息删除
export function getsupplierdel(id){
  return request({
    url:'system/stock/supplier_delete/'+id,
    method:'delete',
    
  })
}
// 库存产品详情页的重订货规则添加
export function getreorderadd(query){
  return request({
    url:'system/stock/reorder_add/',
    method:'post',
    data:query
  })
}
// 库存产品详情页的重订货规则修改
export function getreorderupdate(query){
  return request({
    url:'system/stock/reorder_update/',
    method:'post',
    data:query
  })
}
// 库存产品详情页的重订货规则删除
export function getreorderDel(id){
  return request({
    url:'system/stock/reorder_delete/'+id,
    method:'delete',
  })
}
// 库存产品详情页的物料清单组件添加
export function addBomPart(que){
  return request({
    url:'system/stock/bom_part_add',
    method:'post',
    data:que
  })
}
// 库存产品详情页的物料清单组件删除
export function delBomPart(id){
  return request({
    url:'system/stock/bom_part_delete/'+id,
    method:'delete',
  })
}
// 产品单位
export function uom(){
  return request({
    url:'/system/stock/uomList',
    method:'get'
  })
}
// 产品数量
export function getnum(id){
  return request({
    url:'system/stock/quant/'+id,
    method:'get'
  })
}